﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;

namespace ICNCentral.InterfazGrafica
{
    public partial class Frm_CargaCPUporDsk : Telerik.WinControls.UI.RadForm
    {
        public Frm_CargaCPUporDsk()
        {
            InitializeComponent();
        }

        private void radTextBox1_TextChanged(object sender, EventArgs e)
        {

            if (Txt_Patrimonio.TextLength == 5)
            {
                Txt_Patrimonio.Enabled = true;
                if (Txt_Patrimonio.TextLength > 4)
                {
                    Btn_Aceptar.Enabled = true;
                }
            }
            else
            {
                Txt_Patrimonio.Enabled = false;
                Btn_Aceptar.Enabled = false;
            }
        }

        private void Txt_Patrimonio_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)(Keys.Enter))
            {
                e.Handled = true; SendKeys.Send("{TAB}");
            }
            base.OnKeyPress(e);

            if (Char.IsDigit(e.KeyChar))
            {
                e.Handled = false;
            }
            else if (Char.IsControl(e.KeyChar))
            {
                e.Handled = false;
            }
            else if (Char.IsSeparator(e.KeyChar))
            {
                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }
        }
    }
}
